load("//:build_variables.bzl", "COPTS")
load("//tools/lint:linters.bzl", "clang_tidy_test")

package(
    default_visibility = ["//:android_cuttlefish"],
)

proto_library(
    name = "cdisk_spec_proto",
    srcs = ["cdisk_spec.proto"],
)

cc_proto_library(
    name = "cdisk_spec_cc_proto",
    deps = [":cdisk_spec_proto"],
)


cc_library(
    name = "image_aggregator",
    srcs = [
        "image_aggregator.cc",
        "sparse_image_utils.cc",
    ],
    hdrs = [
        "image_aggregator.h",
        "sparse_image_utils.h",
    ],
    copts = COPTS + [
        "-Wno-packed-non-pod",
    ],
    strip_include_prefix = "//cuttlefish",
    deps = [
        ":cdisk_spec_cc_proto",
        "//cuttlefish/common/libs/fs",
        "//cuttlefish/common/libs/utils:cf_endian",
        "//cuttlefish/common/libs/utils:files",
        "//cuttlefish/common/libs/utils:result",
        "//cuttlefish/common/libs/utils:size_utils",
        "//cuttlefish/common/libs/utils:subprocess",
        "//cuttlefish/host/libs/config:config_utils",
        "//cuttlefish/host/libs/config:cuttlefish_config",
        "//cuttlefish/host/libs/config:known_paths",
        "//cuttlefish/host/libs/config:mbr",
        "//libbase",
        "//libsparse",
        "@protobuf",
        "@zlib",
    ],
)

clang_tidy_test(
    name = "image_aggregator_clang_tidy",
    srcs = [":image_aggregator"],
    tags = ["clang_tidy", "clang-tidy"],
)
